From: George Dunlap Date: Tue, 9 Dec 2014 14:04:19 +0000 (+0000) Subject: libxl: Tell qemu to use raw format when using a tapdisk X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4007 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=7e88c23239591e2638bcc944151a660fcd53495b;p=xen.git libxl: Tell qemu to use raw format when using a tapdisk At the moment libxl unconditinally passes the underlying file format to qemu in the device string. However, when tapdisk is in use, tapdisk handles the underlying format and presents qemu with effectively a raw disk. When qemu looks at the tapdisk block device and doesn't find the image format it was looking for, it will fail. This effectively means that tapdisk cannot be used with HVM domains at the moment except for raw files. Instead, if we're using a tapdisk backend, tell qemu to use a raw file format. Signed-off-by: George Dunlap Acked-by: Ian Campbell Acked-by: Wei Liu [ ijc -- nuked extra blank line ] --- diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index b25b574463..c2b0487c0e 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -797,11 +797,13 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, continue; } - if (disks[i].backend == LIBXL_DISK_BACKEND_TAP) + if (disks[i].backend == LIBXL_DISK_BACKEND_TAP) { + format = qemu_disk_format_string(LIBXL_DISK_FORMAT_RAW); pdev_path = libxl__blktap_devpath(gc, disks[i].pdev_path, disks[i].format); - else + } else { pdev_path = disks[i].pdev_path; + } /* * Explicit sd disks are passed through as is.